import static org.junit.Assert.*;

import java.io.FileNotFoundException;
import java.io.FileReader;

import org.junit.Before;
import org.junit.Test;

public class WordIndexTest {

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void test1() {

		// Declare variables
		String testInput = "trkyue";
		String expOutput = "turkey";

		WordIndex Test1 = new WordIndex(null);
		FileReader fileReader = null;
		try {
			fileReader = new FileReader("10kwords.txt");
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// Create WordIndex object called "idx" created by fileReader (aka
		// 10kwords.txt file)
		WordIndex idx = new WordIndex(fileReader);

//		Test1.main(null);
//		assertEquals(expOutput, Test1.lookup(testInput);
//		WordIndex.main(null);

		// Test Expected Output
		System.out.println(Test1.lookup(testInput));
		assertEquals(expOutput, Test1.lookup(testInput));
	}

	@Test
	public void test2() {

		// Declare variables
		String testInput = "ogd";
		String expOutput = "god,dog";

		// WordIndex wiTest = new WordIndex(null);
		WordIndex.main(null);

		// Test Expected Output
		assertEquals(expOutput, WordIndex.lookup(testInput));
	}

}
